package com.analysis.apresunday.controller;

import com.analysis.apresunday.config.R;
import com.analysis.apresunday.entity.po.AnalysisProvince;
import com.analysis.apresunday.service.AnalysisProvinceService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;

@RestController
@RequestMapping("/provinceInfo")
@CrossOrigin
@Slf4j
@Tag(name = "省份岗位数量分析")
public class AnalysisProvinceController {

    @Resource
    AnalysisProvinceService analysisProvinceService;

    @Operation(summary = "获取省份统计数据")
    @GetMapping("/getStatisticList")
    public R getProvinceStatistic() {
        List<AnalysisProvince> analysisProvinceList = analysisProvinceService.getProvinceList();
        return R.ok().data("analysisProvinceList",analysisProvinceList);
    }

}
